//  This file is part of Swordbible - http://www.swordwarrior.net
//  Copyright (C) 2003-2009 Manu Mital mital.manu@gmail.com

//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2, or (at your option)
//  any later version.

//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.

//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software Foundation,
//  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#include <StdAfx.h>
#include ".\rangeset.h"

CRangeSet::CRangeSet(void)
{
}

CRangeSet::~CRangeSet(void)
{
}

BOOL CRangeSet::FromPos(int pos, int& l, int& u, CString& text) // get the string and bounds 
																//corresponding to a particular position
{
	
	it = my_set.lower_bound(Range(pos,pos));

	if ( it!=my_set.end() && it->min_value <= pos  &&  pos <= it->max_value )	
		{  text =  it->link;  l = it->min_value; u = it->max_value; return TRUE; }

	else return FALSE;

}


